//
//  UIImage+Jeask.m

//  Created by ti on 15/8/2.
//  Copyright (c) 2015年 ti. All rights reserved.
#import "UIImage+Jeask.h"

@implementation UIImage (Jeask)


-(UIImage *)scaleImageWithFactor:(CGFloat)factor
{
    return [UIImage imageWithCGImage:self.CGImage scale:factor orientation:UIImageOrientationUp];
}


+(UIImage *)imageWithName:(NSString *)name Factor:(CGFloat)factor
{
    NSString *imagePath = [[NSBundle mainBundle] pathForResource:name ofType:@"png"];
    return [UIImage imageWithCGImage:[UIImage imageWithContentsOfFile:imagePath].CGImage scale:factor orientation:UIImageOrientationUp];
}


+(UIImage *)inquireWithName:(NSString *)name
{
    return [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:name ofType:@"png"]];
}

-(UIImage *)resizeImageWithTop:(CGFloat)top Left:(CGFloat)left Bottom:(CGFloat)bottom Right:(CGFloat)right
{
    return [self resizableImageWithCapInsets:UIEdgeInsetsMake(self.size.height * top, self.size.width * left, self.size.height * bottom, self.size.width * right)];
}

-(UIImage *)scale:(CGFloat)scale
{
    return [UIImage imageWithCGImage:self.CGImage scale:scale orientation:UIImageOrientationUp];
}



@end
